﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DcsGauges.Server.Models;
using DcsGauges.Server.Network;
using System.Windows.Input;
using Microsoft.Practices.Prism.Commands;
using System.Reflection;

namespace DcsGauges.Server.ViewModels
{
    class MainWindowViewModel : ViewModelBase
    {
        private DataDispatcher              dispatcher              = new DataDispatcher();
        private ServerModel                 model                   = new ServerModel();

        private DcsA10ToolsViewModel dcsA10ToolsViewModel = new DcsA10ToolsViewModel();
        public DcsA10ToolsViewModel DcsA10ToolsViewModel
        {
            get { return this.dcsA10ToolsViewModel; }
            set
            {
                if (this.dcsA10ToolsViewModel != value)
                {
                    this.dcsA10ToolsViewModel = value;
                    this.OnPropertyChanged(MethodBase.GetCurrentMethod());
                }
            }
        }

        private ServerViewModel serverViewModel = null;
        public ServerViewModel ServerViewModel
        {
            get { return this.serverViewModel; }
            set
            {
                if(this.serverViewModel != value)
                {
                    this.serverViewModel = value;
                    this.OnPropertyChanged(MethodBase.GetCurrentMethod());
                }
            }
        }

        private ClientsViewModel clientsViewModel = null;
        public ClientsViewModel ClientsViewModel
        {
            get { return this.clientsViewModel; }
            set
            {
                if(this.clientsViewModel != value)
                {
                    this.clientsViewModel = value;
                    this.OnPropertyChanged(MethodBase.GetCurrentMethod());
                }
            }
        }
        
        public MainWindowViewModel()
        {
            this.ServerViewModel                = new ServerViewModel(this.model);
            this.ClientsViewModel               = new ClientsViewModel(this.model);
        }
    }
}
